<template>
  <div class="head">
    <input type="text" v-model="msg">
    <button @click="add">添加</button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
const msg = ref('')
const data = ref('')
const list = ref(['html', 'css', 'js'])
const add = () => {
  data.value = msg.value
  list.value.push(data.value)
}

defineExpose({
  list
})
</script>

<style lang="css" scoped></style>